package com.itheima.web.controller.cms;

import com.itheima.result.AjaxResult;
import com.itheima.service.cms.CmsPrefrenceAreaService;
import com.itheima.vo.cms.CmsPrefrenceArea;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 前端控制器
 */
@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {

    @DubboReference //远程调用注册中心
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    /**
     * 查询所有商品优选
     * @return
     */
    @GetMapping("/listAll")
    public AjaxResult listAll(){
        List<CmsPrefrenceArea> list = cmsPrefrenceAreaService.list();
        return AjaxResult.success(list);
    }

}
